#!/usr/bin/python3
# -*- coding: utf-8 -*-

from flask import Blueprint
from ..controllers.user_controller import UserController

# 创建蓝图
user_bp = Blueprint('user', __name__)

# 所有接口都使用POST方法，保持统一风格
user_bp.route('/users/<user_id>', methods=['POST'])(UserController.update_user)  # 更新用户
user_bp.route('/users', methods=['POST'])(UserController.list_users)  # 获取用户列表，改为POST
user_bp.route('/mock-userinfo', methods=['POST'])(UserController.mock_userinfo)  # 获取模拟资源，改为POST

# RESTful接口也改为POST方法保持一致
user_bp.route('/users/get/<user_id>', methods=['POST'])(UserController.get_user)  # 获取单个用户，改为POST
user_bp.route('/users/delete/<user_id>', methods=['POST'])(UserController.delete_user)  # 删除用户，保持POST

# 旧API支持
user_bp.route('/update-user', methods=['POST'])(UserController.legacy_update_user) 